﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using StyleMVVM.Configuration;
using StyleMVVM.DependencyInjection;
using StyleMVVM.ViewModel;
using Windows.Storage;

namespace ExampleApp.ViewModels
{
	public class SettingsCharmViewModel : BaseViewModel
	{
		private string configValue;

		public string ConfigValue
		{
			get
			{
				return configValue;
			}
			set
			{
				if(SetProperty(ref configValue, value))
				{
					ApplicationData.Current.RoamingSettings.Values["ConfigValue"] = configValue;
				}
			}
		}

		[ActivationComplete]
		public void Activation()
		{
			ConfigValue = ApplicationData.Current.RoamingSettings.Values["ConfigValue"] as string;
		}
	}
}
